package org.jeecg.modules.system.util;

import org.apache.commons.lang.StringUtils;

public class StringUtil {

    static final String ENCRYPT_11 = "********";
    static final String ENCRYPT_18 = "***************";



    public static String get(String value) {
        if (StringUtils.isBlank(value)) {
            return "";
        }
        if (value.length() == 11) {
            return value.substring(0, 2) + ENCRYPT_11 + value.substring(9, 11);
        } else if (value.length() == 18) {
            return value.substring(0, 2) + ENCRYPT_18 + value.substring(16, 18);
        } else {
            return "//";
        }
    }
}
